mui.plusReady(function() {
	var self = plus.webview.currentWebview();
	var rname = self.name;
	var rheadimg = self.headimg;
//		document.getElementsByClassName("people-bg")[0].style.backgroundImage = 'url('+rheadimg+')'
	var type = self.type;
	var p = null;
	var arr = ['.', '..', '...'];

	var num = 0;
	function qiehuan() {
		num++
		if(num > 3) {
			num = 1
		}
		document.getElementById("dian").innerHTML = arr[num - 1]
	}
	setInterval(function() {
		qiehuan();
	}, 600)

	var vio = new Vue({
		el: '.mui-content',
		data: {
			rheadimg: rheadimg,
			rname: rname,
			headimg: user_info.headimg
		},
		methods: {
			closevio: function() {
				mui.toast('已挂断');
				killcall()
			},
		},
		filters: {
			liwpic: function(value) {
				return "../img/gift/" + value + ".png"
			}
		}
	});
	var shenhe = true;
	if(!isallpay()) {
		shenhe = false;
	}

	function killcall() {
		p.stop();
		p = plus.audio.createPlayer("_www/img/audio/c.mp3");
		p.play();
		setTimeout(function() {
			mui.back()
		}, 1000)
	}

	if(!shenhe || user_info.coin > 10) {
		p = plus.audio.createPlayer("_www/img/audio/b.mp3");
		p.play();
		setTimeout(function() {
			mui.toast('对方不在线或无人接听');
			killcall()
		}, 30000)
	} else {
		p = plus.audio.createPlayer("_www/img/audio/c.mp3");
		p.play();
		mui.toast('余额不足，无法通话！');
		openWallet('wallet.html',1)
		setTimeout(function() {
			plus.webview.close( self,'none');
		}, 1200)
	}

});